put newFileName("Select a filename:") into fileName
newStack fileName
if fileName <> empty then
lock screen
push cd
put cd field archScript of cd 1 into archScript
go cd test
if short name of this cd = "test" then
doMenu "Copy Card"
set the script of stack filename to empty
go stack fileName
if short name of this stack = short name of fileName then
doMenu "Paste Card"
go first
doMenu "Delete Card"
set the script of this stack to archScript
put return&return& "Click anywhere to return" into cd fld archTest
end if
pop cd
show cd btn "Visit the New Stack"
end if
unlock screen
end if
end mouseUp
-- part 419 (field)
-- low flags: 01
-- high flags: 0002
-- rect: left=192 top=282 right=331 bottom=498
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: archScript
-- part 421 (field)
-- low flags: 00
-- high flags: 0004
-- rect: left=85 top=24 right=85 bottom=426
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 20
-- style flags: 256
-- line height: 26
-- part name: Title
-- part 422 (field)
-- low flags: 01
-- high flags: 2007
-- rect: left=85 top=107 right=257 bottom=427
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 33
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Description
-- part 423 (field)
-- low flags: 00
-- high flags: 0001
-- rect: left=170 top=54 right=80 bottom=329
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 9
-- style flags: 256
-- line height: 12
-- part name: Author
-- part 424 (button)
-- low flags: 80
-- high flags: A003
-- rect: left=13 top=282 right=331 bottom=182
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Visit the New Stack
----- HyperTalk script -----
on mouseUp
global fileName
push cd
hide me
visual effect dissolve slowly
go fileName
wait until the mouseClick
lock screen
put empty into msg
hide msg
unlock screen
visual effect dissolve slowly
pop cd
end mouseUp
-- part contents for card part 395
----- text -----
farby-warby
doodle boof turkey
this is poodldy doop
dill &
sweet
pickle factory with plenty of wonder beans
-- part contents for card part 396
----- text -----
The field below contains word buttons
-- part contents for card part 397
----- text -----
The field below contains phrase buttons
-- part contents for card part 398
----- text -----
farby-warby
doodly boof turkey
this is poodldy doop
dill pickle &
sweet
pickle factory with plenty of wonder beans
& a duck of pleasure
-- part contents for card part 400
----- text -----
The field below contains line buttons
-- part contents for card part 401
----- text -----
farby-warby
doodly boof turkey
this is poodldy doop
dill pickle &
sweet
pickle factory with plenty of wonder beans
& a duck of pleasure
farby-warby
doodle boof turkey
this is poodldy doop
dill &
sweet
pickle factory with plenty of wonder beans
-- part contents for card part 419
----- text -----
on openStack
put "This stack comes complete with script"
end openStack
-- part contents for card part 420
----- text -----
on openStack
doMenu "Copy Card"
lock screen
go stack "Fred Bachs:Programming:HC Externals:XTest"
go last
doMenu "Paste Card"
unlock screen
put "Operation successful!"
end openStack
on startup
end startup
-- part contents for card part 421
----- text -----
newStack XCMD
-- part contents for card part 422
----- text -----
The newStack XCMD creates a minimal HyperCard stack. It takes a single parameter, the path name of the new file. Its syntax is:
newStack "myDisk:aFolder:<etc.>:myStack"
Use the button below to create a new stack containing the script in the adjacent field and a single card equal to the second card of this stack. Inspect the script of the button to see how this is done. Note the importance of the conditionals in the button script. Copying and deleting cards between stacks can be dangerous unless you carefully check where you are at all times.
Both the XCMD and the ARCH resources must be present in the parent stack, home stack or HyperCard for this external command to function properly.
newStack may be freely used and distributed for any non-commercial purpose, as long as the paragraph you are reading and my address are retained somewhere in the enabling stack. It may not be distributed as part of any "shareware" package being sold for profit or being used to promote other profit-making activities. If you wish to make commercial use of newStack, contact me to work out a mutually satisfactory arrangement.
Eric Kofoid 22 March 1990
Dept. Biology, U. of Utah
S.L.C., Utah 84112
(801) 581-3592
kofoid@bioscience.utah.edu
This stack employs the newFileName XFCN written by Andrew Gilmartin.